<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" 
      xmlns:th="http://www.thymeleaf.org" 
      xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3" 
      xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" 
      layout:decorator="layout/main">
    <head>
        <title layout:fragment="title">Smarter Life</title> 
    </head>
    <body>
        <div class="ui purple menu" layout:fragment="header">
            <a class="active item">
                <i class="home icon"></i> 主页
            </a>
            <a class="item">
                <i class="mail icon"></i> 消息
            </a>
            <a class="item">
                <i class="user icon"></i> 朋友们
            </a>
            <div class="item">
                <div class="ui teal button">注册</div>
            </div>
            <div class="item">
                <div class="ui button">登录</div>
            </div>
        </div>

        <div class="ui breadcrumb" layout:fragment="breadcrumb">
            <a class="section">首页</a>
            <i class="right arrow icon divider"></i>
            <a class="section">用户</a>
            <i class="right arrow icon divider"></i>
            <div class="active section">登录</div>
        </div>

        <div layout:fragment="content">
            <div th:if="${#httpServletRequest.remoteUser != null}">
                <div sec:authentication="name"></div>
                Hello <span th:text="${#httpServletRequest.remoteUser}">user</span>!
                <form th:action="@{/user/logout}" method="post">
                    <input type="submit" value="登出" />
                </form>
                <h1 th:text="#{i18n.test}"></h1>
                <h1 th:text="${#themes.code('xxx')}"></h1>
            </div>
            <div th:if="${#httpServletRequest.remoteUser == null}">
                <a th:href="@{/user/login}">登录</a>
                <a th:href="@{/user/register}">注册</a>
                <h1 th:text="#{i18n.test}"></h1>
                <h1 th:text="${#themes.code('xxx')}"></h1>
            </div>
        </div>
        <div th:replace="layout/footer :: footer">&copy; 2013 The Static Templates</div>
        <div th:include="layout/footer :: footer-admin">&copy; 2013 The Static Templates</div>
    </body>
</html>